# AC_ENABLE_DEBUG - implement the --enable-debug flag
# Usage: AC_ENABLE_DEBUG[(DEFAULT)]
#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
#   `no'.
AC_DEFUN([AC_ENABLE_DEBUG],
[define([AC_ENABLE_DEBUG_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(debug,
changequote(<<, >>)dnl
<<  --enable-debug          activate debug extensions and -g [default=>>AC_ENABLE_DEBUG_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case $enableval in
yes) enable_debug=yes ;;
no) enable_debug=no ;;
*)
  enable_debug=no
  # Look at the argument we got.  We use all the common list separators.
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  for pkg in $enableval; do
    if test "X$pkg" = "X$p"; then
      enable_debug=yes
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac],
enable_debug=AC_ENABLE_DEBUG_DEFAULT)dnl
])

# AC_ENABLE_OPTIM - implement the --enable-optim flag
# Usage: AC_ENABLE_OPTIM[(DEFAULT)]
#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
#   `yes'.
AC_DEFUN([AC_ENABLE_OPTIM],
[define([AC_ENABLE_OPTIM_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(optim,
changequote(<<, >>)dnl
<<  --enable-optim          optimize program execution time [default=>>AC_ENABLE_OPTIM_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case $enableval in
yes) enable_optim=yes ;;
no) enable_optim=no ;;
*)
  enable_optim=no
  # Look at the argument we got.  We use all the common list separators.
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  for pkg in $enableval; do
    if test "X$pkg" = "X$p"; then
      enable_optim=yes
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac],
enable_optim=AC_ENABLE_OPTIM_DEFAULT)dnl
])

# AC_ENABLE_PROFILE - implement the --enable-profile flag
# Usage: AC_ENABLE_PROFILE[(DEFAULT)]
#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
#   `no'.
AC_DEFUN([AC_ENABLE_PROFILE],
[define([AC_ENABLE_PROFILE_DEFAULT], ifelse($1, no, no, yes))dnl
AC_ARG_ENABLE(profile,
changequote(<<, >>)dnl
<<  --enable-profile        activate profiling [default=>>AC_ENABLE_PROFILE_DEFAULT],
changequote([, ])dnl
[p=${PACKAGE-default}
case $enableval in
yes) enable_profile=yes ;;
no) enable_profile=no ;;
*)
  enable_profile=no
  # Look at the argument we got.  We use all the common list separators.
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  for pkg in $enableval; do
    if test "X$pkg" = "X$p"; then
      enable_profile=yes
    fi
  done
  IFS="$ac_save_ifs"
  ;;
esac],
enable_profile=AC_ENABLE_PROFILE_DEFAULT)dnl
])
